package cn.yuyiling.jelly.sr.mongodb.repository;

import cn.yuyiling.jelly.sr.mongodb.entity.UserLearningRecord;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.Date;
import java.util.List;

public interface UserLearningRecordRepository extends MongoRepository<UserLearningRecord, String> {

    /**
     * 根据用户ID和知识点ID查找学习记录
     */
    List<UserLearningRecord> findByUserIdAndKnowledgePointId(String userId, String knowledgePointId);

    /**
     * 查找用户的最近学习记录（过去一周）
     */
    List<UserLearningRecord> findByUserIdAndCreatedAtAfter(String userId, Date date);

    /**
     * 查找特定答题记录
     */
    List<UserLearningRecord> findByQuizResultAnswerId(String answerId);


    List<UserLearningRecord> findByUserId(String userId);
}